package cn.itsource.constants;


import java.util.Arrays;
import java.util.List;

//常量维护
public class Constants {

    //手机号正则表达式
    public static final String CHINA_PHONE_REGEX =  "^((13[0-9])|(14[0,1,4-9])|(15[0-3,5-9])|(16[2,5,6,7])|(17[0-8])|(18[0-9])|(19[0-3,5-9]))\\d{8}$";

    //编码
    public static final String UTF_8 = "UTF-8";
   //订单状态
   public class Order {
       //0等待接单，1已接单，2司机已到达，3开始代驾，4结束代驾，5.司机确认费用，6未付款，7已付款，8订单已结束，9顾客撤单，10司机撤单，11事故关闭，12其他

       /**
        * 等待接单 -0
        */
       public static final int ORDER_STATUS_WAIT = 0;
       /**
        * 已接单 -1
        */
       public static final int ORDER_STATUS_ACCEPTED = 1;
       /**
        * 司机到达-2
        */
       public static final int ORDER_STATUS_ARRIVE = 2;
       /**
        * 开始代驾-3
        */
       public static final int ORDER_STATUS_START_DRIVING = 3;
       /**
        * 结束代驾 -4
        */
       public static final int ORDER_STATUS_COMPLETE_DRIVED = 4;
       /**
        * 司机确认费用- 5
        */
       public static final int ORDER_STATUS_ENSURE = 5;
       /**
        * 未付款 - 6
        */
       public static final int ORDER_STATUS_NOT_PAY = 6;
       /**
        * 已付款- 7
        */
       public static final int ORDER_STATUS_PAYED = 7;
       /**
        * 订单已结束 - 8
        */
       public static final int ORDER_STATUS_FINISH_ORDER = 8;
       /**
        * 顾客撤单 - 9
        */
       public static final int ORDER_STATUS_CUSTOMER_CANCEL_ORDER = 9;
       /**
        * 司机取消 - 10
        */
       public static final int ORDER_STATUS_DRIVER_CANCEL_ORDER = 10;
       /**
        * 事故关闭 - 11
        */
       public static final int ORDER_STATUS_ACCIDENT_CLOSE = 11;
       /**
        * 其他 -12
        */
       public static final int ORDER_STATUS_OTHER = 12;

       //乘客进行中的订单
       public static final List<Integer> ORDER_STATUS_IN_PROCESS_CUSTOMER = Arrays.asList(
               ORDER_STATUS_WAIT, ORDER_STATUS_ACCEPTED,
               ORDER_STATUS_ARRIVE, ORDER_STATUS_START_DRIVING,
               ORDER_STATUS_COMPLETE_DRIVED,
               ORDER_STATUS_ENSURE, ORDER_STATUS_NOT_PAY
       );
       //司机进行中的订单
        public static final List<Integer> ORDER_STATUS_IN_PROCESS_DRIVER = Arrays.asList(
               ORDER_STATUS_WAIT, ORDER_STATUS_ACCEPTED,
               ORDER_STATUS_ARRIVE, ORDER_STATUS_START_DRIVING,
               ORDER_STATUS_COMPLETE_DRIVED,
               ORDER_STATUS_ENSURE
        );


   }

    //用户的权限
    public class Redis{
        public static final String KEY_PREFIX_PERMISSIONS = "permissions:%s";

        public static final String DRIVER_SETTING = "driver:setting:%s";

        public static final String DRIVER_GEO = "driver:geo";

        public static final String KEY_PREFIX_LOGIN_INFO = "login:info:%s";

        public static final String KEY_PREFIX_ORDER = "order:%s";
        //给订单上锁
        public static final String LOCK_ORDER = "lock:order:%s";
    }

    //认证服务
    public class Login {
        //0为审核中1为审核通过2为审核拒绝
        public static final int STATUS_APPLY = 0;
        public static final int STATUS_SUCCESS = 1;
        public static final int STATUS_REJECT = 2;
    }

    //司机服务
    public class MQ {

        //订单的Topic,tags
        public static final String TOPIC_ORDER_DRIVER = "TOPIC_ORDER_TOD_DRIVER";
        public static final String TAGS_ORDER_TOD_DRIVER = "TAGS_ORDER_TOD_DRIVER_%s";



    }
    //司机服务
    public class Driver {

        //0是平台账户，1是司机账户，2是客户账户
        public static final int TYPE_ADMIN = 0;
        public static final int TYPE_DRIVER = 1;
        public static final int TYPE_CUSTOMER = 2;



    }

    //认证服务
    //远程调用
    public class Remote {
        //服务名
        public static final String SERVICE_UAA = "fccar-service-uaa";

        public static final String PREFIX_LOGIN_REMOTE = "/login/remote";

        public static final String SERVICE_CUSTOMER = "fccar-service-customer";

        public static final String SERVICE_BIGDATA = "fccar-service-bigdata";
    }

}
